package com.tobby.camelinaction.component;

import org.apache.camel.Exchange;
import org.apache.camel.impl.DefaultProducer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * The My producer.
 */
public class MyProducer extends DefaultProducer {

	private static final transient Logger LOG = LoggerFactory.getLogger(MyProducer.class);

	@SuppressWarnings("unused")
	private MyEndpoint endpoint;

	public MyProducer(MyEndpoint endpoint) {
		super(endpoint);
		this.endpoint = endpoint;
	}

	public void process(Exchange exchange) throws Exception {
		LOG.info(exchange.getIn().getBody().toString());
		System.out.println(exchange.getIn().getBody());
	}

}
